// pages/Itinerary/myLtinerary/myLtinerary.js
import { getItineraryListForPageForUser } from '../../api/home'
import { imageURL } from '../../../utils/request'

Page({

  /**
   * 頁面的初始數據
   */
  data: {
    imageURL:'',
    myItineraryList:[]
  },

  onLoad(options) {
    this.setData({imageURL})
    this.getList()
  },
  async getList(){
    const res = await getItineraryListForPageForUser({
      page:1,
      rows:9999
    })
    this.setData({
      myItineraryList:res.data.list
    })
  },
  goMyItinerary(e){
    const itinerary_id = e.currentTarget.dataset.itinerary_id
    wx.navigateTo({
      url: `/pages/Itinerary/myItineraryDetails/myItineraryDetails?itinerary_id=${itinerary_id}`,
    })
  },
})